//
//  MineSettingHeaderView.m
//  Peso Guide
//
//  Created by macbook on 2025/6/12.
//

#import "MineSettingHeaderView.h"

@interface MineSettingHeaderView ()

@property (nonatomic, strong) UIView *backView;
@property (nonatomic, strong) UIView *bottomView;
@property (nonatomic, strong) UIImageView *topImg;
@property (nonatomic, strong) UILabel *versionLabel;

@end

@implementation MineSettingHeaderView

- (id)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgroundColor = ColorHex(@"#1A7A35");
        
        _backView = [PesoKit createViewWithFrame:CGRectMake(0, 0, KScreenWidth, 216) backGroundColor:ColorHex(@"#1A7A35")];
        [self addSubview:_backView];
        
        _bottomView = [PesoKit createViewWithFrame:CGRectMake(0, 216, KScreenWidth, 30) backGroundColor:ColorHex(@"#FFFFFF")];
        _bottomView.clipsToBounds = YES;
        _bottomView.layer.mask = [AppTools clipTopRightAndLeftByRoundingCorners:_bottomView radii:CGSizeMake(15.0f, 15.0f)];
        [self addSubview:_bottomView];
        
        _topImg = [PesoKit createImageViewWithFrame:CGRectMake((KScreenWidth-133)/2.0, 52, 133, 98) imageNamed:@"ic_setting_top"];
        [_backView addSubview:_topImg];
        
        NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
        NSString *applocalversion = [infoDictionary objectForKey:@"CFBundleShortVersionString"];
        
        _versionLabel = [PesoKit createLabelWithFrame:CGRectMake(10, 168, KScreenWidth-20, 20) backGroundColor:[UIColor clearColor] text:[NSString stringWithFormat:@"V%@",applocalversion] textColor:ColorHex(@"#FFFFFF") font:FONT(FontWeightStyleRegular, 14)];
        _versionLabel.textAlignment = NSTextAlignmentCenter;
        [_backView addSubview:_versionLabel];
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
